Skip to content

Conversation

@yuuki
Copy link
Owner

@yuuki yuuki commented Jun 13, 2025

Summary

Fixes an issue where client-side processes running in high-load ephemeral TCP or UDP mode cannot receive SIGINT signals for graceful termination.

  • Enhanced context cancellation responsiveness in rate limiting
  • Added explicit context checks in connection loops to break early on cancellation
  • Replaced blocking Dial() calls with context-aware DialContext()
  • Added connection deadlines to make Read/Write operations interruptible
  • Fixed loop break statements to properly exit on context cancellation

Test plan

  • All existing tests pass (make test)
  • Build verification passes (make build)
  • Manual testing confirms improved responsiveness to termination signals
  • High-load ephemeral client now terminates quickly on SIGINT instead of waiting for all connections

🤖 Generated with Claude Code

yuuki and others added 5 commits June 13, 2025 01:40
- Enhanced waitLim() function to be more responsive to context cancellation
- Added explicit context checks in ephemeral/UDP connection loops
- Replaced Dial with DialContext for context-aware connection establishment
- Added connection deadlines based on context for interruptible network operations
- Fixed labeled breaks to properly exit loops on cancellation

Resolves issue where client processes in high-load ephemeral mode could not
receive SIGINT signals due to thousands of goroutines blocking in network I/O.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…ncellation

- Added TestWaitLimContextCancellation to verify improved waitLim responsiveness
- Added TestConnectEphemeralContextCancellationLoop to test ephemeral loop cancellation
- Added TestConnectUDPContextCancellationLoop to test UDP loop cancellation
- Added TestConnectPersistentContextCancellationQuick for persistent connection cancellation
- Added TestDialContextWithTimeout to verify DialContext respects context timeouts
- Added TestConnectionDeadlineHandling to test connection deadline functionality
- Added TestEphemeralLoopBreakOnCancellation to verify labeled break functionality
- Added TestUDPLoopBreakOnCancellation to test UDP loop break behavior
- Added TestWaitLimRateLimitingBehavior to test rate limiting while maintaining responsiveness

Coverage improved from 59.9% to 60.8% of statements.
All tests specifically validate the SIGINT handling improvements made to client.go.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@yuuki yuuki merged commit ebced03 into main Jun 13, 2025
1 check passed
@github-actions github-actions bot mentioned this pull request Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants